<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Document</title>
	</head>

	<body>
		<div id="app">
			<button @click="btn1Click">按钮1</button>
			<!-- 要事件定义时，写方法省略了()，但方法本身需要一个参数，Vue会默认将浏览器
      的event事件对象作为参数传入方法 -->
			<button @click="btn2Click">按钮2</button>
			<!-- 事件定义时，需要event，还需要其它参数时 -->
			<button @click="btn3Click(124,$event)">按钮3</button>
		</div>

		<script src="../lib/vue.js"></script>
		<script>
			let vm = new Vue({
				el: "#app",
				data: { message: "hello" },
				methods: {
					btn1Click() {
						console.log("btn1Click");
					},
					btn2Click(event) {
						console.log("----", event);
					},
					btn3Click(abc, event) {
						console.log("++++", abc, event);
					}
				}
			});
		</script>
	</body>
</html>
